<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class StoreRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
	//验证规则
	public function rules()
	{
		return array (
			'name'=>'required',
			'run'=>'required',
			'introduct'=>'required',
			'address'=>'required',
			'phone'=>'required',
			'cid'=>'required',
			'ewm'=>'required',
			'face'=>'required',
			'dianzhao'=>'required',
			'src'=>'required',
			'position'=>'required'

		);
	}

	//错误信息处理
	public function messages()
	{
		return array (
			'name.required'=>'请输入店铺名称',
			'run.required'=>'请输入经营范围',
			'introduct.required'=>'请输入店铺简介',
			'address.required'=>'请输入店铺地址',
			'phone.required'=>'请输入联系电话',
			'cid.required'=>'请选择分类',
			'ewm.required'=>'请上传店铺二维码',
			'face.required'=>'请上传店铺封面',
			'dianzhao.required'=>'请上传店招图片',
			'src.required'=>'请上传店铺图片集',
			'position.required'=>'请在地图上选择店铺位置'
		);
	}
}
